#include <func.h>
int gobal=0;
int main()
{
    int *p=(int *)malloc(sizeof(int));
    *p=0;
    int stack=2;
    if(fork()==0)
    {
        //子进程
        *p+=5;
        stack+=6;
        gobal+=9;
        printf("*p=%d gobal=%d stack=%d\n",*p,gobal,stack);
    }
    else
    {
        //父进程
        printf("*p=%d gobal=%d stack=%d\n",*p,gobal,stack);
    }
    free(p);
    return 0;
}

